/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pkg0912144.pkg0912207.array;

import Algorithm.NomalSort;
import comparetor.CompareInt;
import comparetor.CompareString;

/**
 *
 * @author khangdc
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        System.out.println("Sort integer - nomal sort");
        HKBox<Integer> intarr = new HKBox<Integer>(Integer.class,10);
        intarr.set(0,20);
        intarr.set(1,10);
        intarr.set(2,5);
        intarr.set(3,-10);
        intarr.set(4,-100);
        intarr.set(5,2000);
        intarr.set(6,160);
        System.out.println("Tăng dần: ");
        intarr.sortAsc(new NomalSort<Integer>(), new CompareInt());
        
        for(int i = 0 ;i < intarr.getSize(); i++)
        {
            System.out.println(intarr.get(i));
        }
        System.out.println("Giảm dần: ");
        intarr.sortDes(new NomalSort<Integer>(), new CompareInt());
        
        for(int i = 0 ;i < intarr.getSize(); i++)
        {
            System.out.println(intarr.get(i));
        }
        
        System.out.println("Sort string - nomal sort");
        HKBox<String> strarr = new HKBox<String>(String.class,10);
        strarr.set(0,"b");
        strarr.set(1,"f");
        strarr.set(2,"d");
        strarr.set(3,"e");
        strarr.set(4,"D");
        strarr.set(5,"8");
        strarr.set(6,"0");
        System.out.println("Tăng dần: ");
        strarr.sortAsc(new NomalSort<String>(), new CompareString());
        
        for(int i = 0 ;i < strarr.getSize(); i++)
        {
            System.out.println(strarr.get(i));
        }
        System.out.println("Giảm dần: ");
        strarr.sortDes(new NomalSort<String>(), new CompareString());
        
        for(int i = 0 ;i < strarr.getSize(); i++)
        {
            System.out.println(strarr.get(i));
        }
    }
}
